<?php
$objCarOptionForm = new BM_PHPForm();
$objCarOptionForm->UseLocator();
$objCarOptionForm->SetIndent("		");

if ($objCarOptionForm->IsPost()) {
	$objCarOptionForm->ChEmptiness("name", "Name is empty.");
	if ($objCarOptionForm->IsValid()) {
		if (CarOptionDao::save($objCarOptionForm->arrPostData['name'])) {
			header("Location:../$www/index_admin.php?entity=caroption&action=list&msg=infSaved");
		}else {
			$objCarOptionForm->SetError("name", "Car option did not saved !");
		}
	}
}

print $objCarOptionForm->InfMsgs();
print $objCarOptionForm->ErrMsgs();

print $objCarOptionForm->Open("caroptionform", "Car Option Form");
print $objCarOptionForm->HiddenField("entity", "$entity");
print $objCarOptionForm->HiddenField("action", "$action");
print $objCarOptionForm->TextBox("name", "Name:", "");
print $objCarOptionForm->SubmitButton("submit", "Submit");
print $objCarOptionForm->Close();

?>